import { ApiCall } from "tsrpc";
import { ReqLogined, ResLogined } from "../../../../tsrpc/shared/protocols/hall/admin/PtlLogined";
import { account } from "../../../../module/account/Account";

export default async function (call: ApiCall<ReqLogined, ResLogined>) {
    // TODO
    var user = call.req.user;
    account.AccountModel.users.set(user.key, user);
    var sso = await account.createSsoToken(user.key);

    call.succ({ __ssoToken: sso });
}